package network;

import java.net.InetAddress;

import shared.Vec2f;
import vmo.PlayerData;

public class Player {

	String m_handle;
	public int m_lastreceived,m_lastsent, m_latency,m_lastupdate;
	InetAddress m_address;
	public PlayerData m_player;
	
	public String getString()
	{
		return m_handle;	
	}
	
	public InetAddress getAddress()
	{
		return m_address;
	}
	
	public Player(String handle, int timestamp, InetAddress address)
	{
		m_handle=handle;
		m_lastreceived=timestamp;
		m_lastsent=timestamp;
		m_address=address;
		m_player=new PlayerData();
		m_player.m_pos=new Vec2f(24.5F,24.5F);
		m_player.m_layer=10;
		m_player.m_entity=0;
		m_player.m_facing=0;
	}	
	
	public Player (String handle, int timestamp, InetAddress address, byte [] data)
	{
		
		m_handle=handle;
		m_lastreceived=timestamp;
		m_lastsent=timestamp;
		m_address=address;
		m_player=new PlayerData();
		m_player.m_pos=new Vec2f(24.5F,24.5F);
		m_player.m_layer=10;
		m_player.m_entity=0;		
		
		m_player.m_facing=0;		
		m_player.m_gender=data[0];	
		m_player.m_hairstyle=data[1];	
		m_player.m_haircolour=data[2];
		m_player.m_skincolour=data[3];
		
	}
	
}
